package org.shadow.shapac;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.preference.PreferenceManager;


public class Splash extends Activity  {
	
	MediaPlayer splashMusic;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		
		splashMusic = MediaPlayer.create(Splash.this, R.raw.flixel);
		
		
		Thread logoTimer = new Thread(){
			public void run(){
				try{
					int logoTimer= 0;
					while (logoTimer < 3000){
						sleep(100);
						logoTimer = logoTimer +100;
					}
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				finally{
					finish();
				}
			}
		};
		logoTimer.start();
		splashMusic.start();
	}
	
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		splashMusic.release();
	}

}
